inherited fmTabel_Create: TfmTabel_Create
  Left = 325
  Top = 270
  Width = 783
  Height = 532
  Caption = #1057#1086#1079#1076#1072#1085#1080#1077' '#1090#1072#1073#1077#1083#1103
  OnShow = FormShow
  PixelsPerInch = 96
  TextHeight = 13
  inherited sbBottom: TStatusBar
    Top = 471
    Width = 775
  end
  inherited Panel1: TPanel
    Width = 775
    inherited BitBtn1: TBitBtn
      Left = 605
    end
    inherited BitBtn2: TBitBtn
      Left = 693
    end
  end
  object ToolBar2: TToolBar [2]
    Left = 0
    Top = 45
    Width = 775
    Height = 34
    AutoSize = True
    BorderWidth = 2
    ButtonHeight = 24
    ButtonWidth = 28
    EdgeInner = esNone
    EdgeOuter = esNone
    Images = DMInv.ilActive
    TabOrder = 2
    TabStop = True
    Transparent = True
    object tbExcel: TToolButton
      Left = 0
      Top = 2
      Caption = 'tbExcel'
      ImageIndex = 16
      OnClick = tbExcelClick
    end
    object ToolButton2: TToolButton
      Left = 28
      Top = 2
      Width = 8
      Caption = 'ToolButton2'
      ImageIndex = 1
      Style = tbsSeparator
    end
    object cxLabel1: TcxLabel
      Left = 36
      Top = 2
      AutoSize = False
      Caption = #1044#1072#1090#1072
      Height = 24
      Width = 37
    end
    object eDate: TcxButtonEdit
      Tag = 11
      Left = 73
      Top = 2
      ParentFont = False
      Properties.Buttons = <
        item
          Glyph.Data = {
            F6000000424DF600000000000000760000002800000010000000100000000100
            0400000000008000000000000000000000001000000000000000000000000000
            8000008000000080800080000000800080008080000080808000C0C0C0000000
            FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFFFF00FFFFFFFFFFFF
            FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
            FFFFFFFFFFF0FFFFFFFFFFFFFF000FFFFFFFFFFFF00000FFFFFFFFFF0000000F
            FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
            FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF}
        end>
      Properties.MaxLength = 0
      Properties.ReadOnly = True
      Properties.OnButtonClick = eDatePropertiesButtonClick
      Properties.OnChange = eDatePropertiesChange
      Style.Font.Charset = DEFAULT_CHARSET
      Style.Font.Color = clWindowText
      Style.Font.Height = -13
      Style.Font.Name = 'Tahoma'
      Style.Font.Style = [fsBold]
      Style.LookAndFeel.SkinName = ''
      Style.Shadow = False
      Style.IsFontAssigned = True
      StyleDisabled.LookAndFeel.SkinName = ''
      StyleFocused.LookAndFeel.SkinName = ''
      StyleHot.LookAndFeel.SkinName = ''
      TabOrder = 0
      Width = 240
    end
  end
  object dbgRS: TcxGrid [3]
    Left = 0
    Top = 161
    Width = 775
    Height = 310
    Align = alClient
    TabOrder = 3
    LookAndFeel.Kind = lfStandard
    object tvRS: TcxGridDBTableView
      NavigatorButtons.ConfirmDelete = False
      NavigatorButtons.First.Visible = True
      NavigatorButtons.PriorPage.Visible = True
      NavigatorButtons.Prior.Visible = True
      NavigatorButtons.Next.Visible = True
      NavigatorButtons.NextPage.Visible = True
      NavigatorButtons.Last.Visible = True
      NavigatorButtons.Insert.Visible = False
      NavigatorButtons.Append.Visible = False
      NavigatorButtons.Delete.Visible = False
      NavigatorButtons.Edit.Visible = False
      NavigatorButtons.Post.Visible = False
      NavigatorButtons.Cancel.Visible = False
      NavigatorButtons.Refresh.Visible = False
      NavigatorButtons.SaveBookmark.Visible = False
      NavigatorButtons.GotoBookmark.Visible = False
      NavigatorButtons.Filter.Visible = False
      DataController.DataSource = dlgDS
      DataController.Summary.DefaultGroupSummaryItems = <>
      DataController.Summary.FooterSummaryItems = <
        item
          Kind = skCount
          FieldName = 'PID'
          Column = tvRSFIO
        end
        item
          Format = '#,###0'
          Kind = skSum
          FieldName = 'ITOGO'
          Column = tvRSITOGO
        end>
      DataController.Summary.SummaryGroups = <>
      OptionsBehavior.CellHints = True
      OptionsBehavior.IncSearch = True
      OptionsCustomize.ColumnFiltering = False
      OptionsData.CancelOnExit = False
      OptionsData.Deleting = False
      OptionsData.DeletingConfirmation = False
      OptionsData.Inserting = False
      OptionsView.NavigatorOffset = 10
      OptionsView.NoDataToDisplayInfoText = '<'#1053#1077#1090' '#1076#1072#1085#1085#1099#1093'>'
      OptionsView.CellAutoHeight = True
      OptionsView.CellTextMaxLineCount = 1
      OptionsView.ColumnAutoWidth = True
      OptionsView.Footer = True
      OptionsView.GroupByBox = False
      OptionsView.Indicator = True
      OptionsView.ShowColumnFilterButtons = sfbAlways
      Preview.Visible = True
      Styles.Content = DMInv.cxData
      Styles.IncSearch = DMInv.cxKrasniyText
      Styles.Selection = DMInv.cxJoltiyFon
      Styles.Header = DMInv.cxSiniyText
      object tvRSFIO_PEDAG: TcxGridDBColumn
        Caption = #1055#1077#1076#1072#1075#1086#1075
        DataBinding.FieldName = 'FIO_PEDAG'
        Options.Editing = False
        Width = 50
      end
      object tvRSFIO: TcxGridDBColumn
        Caption = #1060#1048#1054
        DataBinding.FieldName = 'FIO'
        Options.Editing = False
        Width = 31
      end
      object tvRSSDNAME: TcxGridDBColumn
        Caption = #1059#1089#1083#1091#1075#1072
        DataBinding.FieldName = 'SDNAME'
        Options.Editing = False
        Width = 43
      end
      object tvRSRSDATE: TcxGridDBColumn
        Caption = #1044#1072#1090#1072' '#1086#1082#1072#1079#1072#1085#1080#1103
        DataBinding.FieldName = 'RSDATE'
        Options.Editing = False
        Width = 86
      end
      object tvRSRSTIMEBEGIN: TcxGridDBColumn
        Caption = #1042#1088'. '#1085#1072#1095#1072#1083#1072
        DataBinding.FieldName = 'RSTIMEBEGIN'
        Options.Editing = False
        Width = 64
      end
      object tvRSRSTIMEEND: TcxGridDBColumn
        Caption = #1042#1088'. '#1086#1082#1086#1085#1095'.'
        DataBinding.FieldName = 'RSTIMEEND'
        Options.Editing = False
        Width = 62
      end
      object tvRSTARIF: TcxGridDBColumn
        Caption = #1058#1072#1088#1080#1092
        DataBinding.FieldName = 'TARIF'
        Options.Editing = False
        Width = 40
      end
      object tvRSRSPCORRECTION: TcxGridDBColumn
        Caption = #1050#1086#1088#1088#1077#1082#1094#1080#1103' '#1090#1072#1088#1080#1092#1072' ('#1091#1084#1077#1085#1100#1096#1077#1085#1080#1077')'
        DataBinding.FieldName = 'RSPCORRECTION'
        PropertiesClassName = 'TcxCalcEditProperties'
        Properties.OnEditValueChanged = tvRSRSPCORRECTIONPropertiesEditValueChanged
        Width = 183
      end
      object tvRSITOGO: TcxGridDBColumn
        Caption = #1048#1090#1086#1075#1086
        DataBinding.FieldName = 'ITOGO'
        Options.Editing = False
        Width = 38
      end
      object tvRSRSPNOTE: TcxGridDBColumn
        Caption = #1050#1086#1084#1084#1077#1085#1090#1072#1088#1080#1081
        DataBinding.FieldName = 'RSPNOTE'
        Options.Editing = False
        Width = 73
      end
    end
    object cxGridLevel7: TcxGridLevel
      GridView = tvRS
    end
  end
  object cxLabel2: TcxLabel [4]
    Left = 0
    Top = 79
    Align = alTop
    Caption = #1050#1086#1084#1084#1077#1085#1090#1072#1088#1080#1081' '#1082' '#1090#1072#1073#1077#1083#1102
  end
  object cxMemo1: TcxMemo [5]
    Left = 0
    Top = 96
    Align = alTop
    TabOrder = 5
    Height = 65
    Width = 775
  end
  inherited dlgDS: TDataSource
    DataSet = qTC
  end
  object qTC: TIBQuery
    Database = DMInv.DBRead
    Transaction = DMInv.IBTransaction1
    BeforePost = qTCBeforePost
    CachedUpdates = True
    SQL.Strings = (
      
        'SELECT rsp.pid, rsp.rsid, rs1.rsdate, sd.SDNAME,IIF(rsp.tid IS N' +
        'ULL,'
      '       (SELECT FIRST 1 dut.ttarif'
      '        FROM dop_usl_tariffs dut'
      '        WHERE dut.pid = :pid AND'
      '              dut.sdid = rs1.sdid  AND'
      
        '               rs1.rsdate BETWEEN dut.TDATEBEGIN AND dut.TDATEEN' +
        'D ),'
      '       (SELECT  dut.ttarif'
      '        FROM dop_usl_tariffs dut'
      '        WHERE dut.tid = rsp.tid)) AS tarif, rsp.rspcorrection,'
      
        '       p1.plastname || '#39' '#39' || SUBSTRING(p1.pname FROM 1 FOR 1) |' +
        '| '#39'. '#39' || COALESCE(SUBSTRING(p1.ppatronymic FROM 1 FOR 1) || '#39'.'#39 +
        ', '#39' '#39') AS fio,'
      
        'p2.plastname || '#39' '#39' || SUBSTRING(p2.pname FROM 1 FOR 1) || '#39'. '#39' ' +
        '|| COALESCE(SUBSTRING(p2.ppatronymic FROM 1 FOR 1) || '#39'.'#39', '#39' '#39') ' +
        'AS fio_pedag,'
      
        '       CAST(0 AS D_FLOAT) AS itogo, rsp.RSPNOTE, rs1.RSTIMEBEGIN' +
        ', rs1.RSTIMEEND'
      'FROM rs_people rsp'
      'INNER JOIN rendering_services rs1 ON rs1.rsid = rsp.rsid'
      'INNER JOIN people p1 ON p1.pid = rsp.pid'
      'INNER JOIN people p2 ON p2.pid = rs1.PID_PEDAG'
      'INNER JOIN SYS_DIC sd ON sd.SDID = rs1.SDID'
      'WHERE rs1.rsisdelete IS NULL AND'
      '      rsp.rsoplatit IS NOT NULL AND'
      '      rsp.rsoplacheno IS NULL AND'
      '      rs1.pid_pedag = :pid'
      '      AND rs1.RSDATE BETWEEN :data1 AND :data2'
      'order by 7,4')
    UpdateObject = quTC
    GeneratorField.Field = 'TABID'
    Left = 296
    ParamData = <
      item
        DataType = ftUnknown
        Name = 'pid'
        ParamType = ptUnknown
      end
      item
        DataType = ftUnknown
        Name = 'pid'
        ParamType = ptUnknown
      end
      item
        DataType = ftUnknown
        Name = 'data1'
        ParamType = ptUnknown
      end
      item
        DataType = ftUnknown
        Name = 'data2'
        ParamType = ptUnknown
      end>
    object qTCRSDATE: TDateField
      FieldName = 'RSDATE'
      Origin = '"RENDERING_SERVICES"."RSDATE"'
    end
    object qTCSDNAME: TIBStringField
      FieldName = 'SDNAME'
      Origin = '"SYS_DIC"."SDNAME"'
      Size = 255
    end
    object qTCTARIF: TIBBCDField
      FieldName = 'TARIF'
      ProviderFlags = []
      Precision = 18
      Size = 2
    end
    object qTCRSPCORRECTION: TIBBCDField
      FieldName = 'RSPCORRECTION'
      Origin = '"RS_PEOPLE"."RSPCORRECTION"'
      Precision = 18
      Size = 2
    end
    object qTCFIO: TIBStringField
      FieldName = 'FIO'
      ProviderFlags = []
      Size = 769
    end
    object qTCITOGO: TIBBCDField
      FieldName = 'ITOGO'
      ProviderFlags = []
      Precision = 18
      Size = 2
    end
    object qTCRSPNOTE: TIBStringField
      FieldName = 'RSPNOTE'
      Origin = '"RS_PEOPLE"."RSPNOTE"'
      Size = 255
    end
    object qTCPID: TIntegerField
      FieldName = 'PID'
      Origin = '"RS_PEOPLE"."PID"'
    end
    object qTCRSID: TIntegerField
      FieldName = 'RSID'
      Origin = '"RS_PEOPLE"."RSID"'
      Required = True
    end
    object qTCFIO_PEDAG: TIBStringField
      FieldName = 'FIO_PEDAG'
      ProviderFlags = []
      Size = 769
    end
    object qTCRSTIMEBEGIN: TTimeField
      FieldName = 'RSTIMEBEGIN'
      Origin = '"RENDERING_SERVICES"."RSTIMEBEGIN"'
    end
    object qTCRSTIMEEND: TTimeField
      FieldName = 'RSTIMEEND'
      Origin = '"RENDERING_SERVICES"."RSTIMEEND"'
    end
  end
  object quTC: TIBUpdateSQL
    RefreshSQL.Strings = (
      'Select '
      '  PID,'
      '  RSID,'
      '  RSDATE,'
      '  SDNAME,'
      '  TARIF,'
      '  RSPCORRECTION,'
      '  FIO,'
      '  ITOGO,'
      '  RSPNOTE'
      'from dop_usl_tariffs '
      'where'
      '  PID = :PID and'
      '  RSID = :RSID')
    ModifySQL.Strings = (
      'update dop_usl_tariffs'
      'set'
      '  ITOGO = :ITOGO,'
      '  RSPCORRECTION = :RSPCORRECTION,'
      '  RSPNOTE = :RSPNOTE'
      'where'
      '  PID = :OLD_PID and'
      '  RSID = :OLD_RSID')
    InsertSQL.Strings = (
      'insert into dop_usl_tariffs'
      '  (ITOGO, RSPCORRECTION, RSPNOTE)'
      'values'
      '  (:ITOGO, :RSPCORRECTION, :RSPNOTE)')
    DeleteSQL.Strings = (
      'delete from dop_usl_tariffs'
      'where'
      '  PID = :OLD_PID and'
      '  RSID = :OLD_RSID')
    Left = 336
  end
  object qTCReal: TIBQuery
    Database = DMInv.DBRead
    Transaction = DMInv.IBTransaction1
    CachedUpdates = True
    SQL.Strings = (
      'SELECT rsp.RSID, rsp.PID, rsp.rspcorrection,'
      ' rsp.RSPNOTE'
      'FROM rs_people rsp'
      'INNER JOIN rendering_services rs1 ON rs1.rsid = rsp.rsid'
      'INNER JOIN people p1 ON p1.pid = rsp.pid'
      'INNER JOIN SYS_DIC sd ON sd.SDID = rs1.SDID'
      'WHERE rs1.rsisdelete IS NULL AND'
      '      rsp.rsoplatit IS NOT NULL AND'
      '      rsp.rsoplacheno IS NULL AND'
      '      rs1.pid_pedag = :pid'
      '      AND rs1.RSDATE BETWEEN :data1 AND :data2'
      '')
    UpdateObject = quTCReal
    GeneratorField.Field = 'TABID'
    Left = 344
    Top = 40
    ParamData = <
      item
        DataType = ftUnknown
        Name = 'pid'
        ParamType = ptUnknown
      end
      item
        DataType = ftUnknown
        Name = 'data1'
        ParamType = ptUnknown
      end
      item
        DataType = ftUnknown
        Name = 'data2'
        ParamType = ptUnknown
      end>
    object qTCRealRSID: TIntegerField
      FieldName = 'RSID'
      Origin = '"RS_PEOPLE"."RSID"'
      Required = True
    end
    object qTCRealPID: TIntegerField
      FieldName = 'PID'
      Origin = '"RS_PEOPLE"."PID"'
    end
    object qTCRealRSPCORRECTION: TIBBCDField
      FieldName = 'RSPCORRECTION'
      Origin = '"RS_PEOPLE"."RSPCORRECTION"'
      Precision = 18
      Size = 2
    end
    object qTCRealRSPNOTE: TIBStringField
      FieldName = 'RSPNOTE'
      Origin = '"RS_PEOPLE"."RSPNOTE"'
      Size = 255
    end
  end
  object quTCReal: TIBUpdateSQL
    RefreshSQL.Strings = (
      'Select '
      '  RSID,'
      '  PID,'
      '  RSPCORRECTION,'
      '  RSPNOTE'
      'from rs_people '
      'where'
      '  PID = :PID and'
      '  RSID = :RSID')
    ModifySQL.Strings = (
      'update rs_people'
      'set'
      '  PID = :PID,'
      '  RSID = :RSID,'
      '  RSPCORRECTION = :RSPCORRECTION,'
      '  RSPNOTE = :RSPNOTE'
      'where'
      '  PID = :OLD_PID and'
      '  RSID = :OLD_RSID')
    InsertSQL.Strings = (
      'insert into rs_people'
      '  (PID, RSID, RSPCORRECTION, RSPNOTE)'
      'values'
      '  (:PID, :RSID, :RSPCORRECTION, :RSPNOTE)')
    DeleteSQL.Strings = (
      'delete from rs_people'
      'where'
      '  PID = :OLD_PID and'
      '  RSID = :OLD_RSID')
    Left = 384
    Top = 40
  end
  object SD1: TSaveDialog
    InitialDir = 'c:\'
    Options = [ofOverwritePrompt, ofHideReadOnly, ofEnableSizing]
    Left = 432
    Top = 40
  end
  object qtemp: TIBQuery
    Database = DMInv.DBRead
    Transaction = DMInv.IBTransaction1
    BeforePost = qTCBeforePost
    SQL.Strings = (
      
        'SELECT rsp.pid, rsp.rsid, rs1.rsdate, sd.SDNAME,IIF(rsp.tid IS N' +
        'ULL,'
      '       (SELECT FIRST 1 dut.ttarif'
      '        FROM dop_usl_tariffs dut'
      '        WHERE dut.pid = :pid AND'
      '              dut.sdid = rs1.sdid  AND'
      
        '               rs1.rsdate BETWEEN dut.TDATEBEGIN AND dut.TDATEEN' +
        'D ),'
      '       (SELECT  dut.ttarif'
      '        FROM dop_usl_tariffs dut'
      '        WHERE dut.tid = rsp.tid)) AS tarif, rsp.rspcorrection,'
      
        '       p1.plastname || '#39' '#39' || SUBSTRING(p1.pname FROM 1 FOR 1) |' +
        '| '#39'. '#39' || COALESCE(SUBSTRING(p1.ppatronymic FROM 1 FOR 1) || '#39'.'#39 +
        ', '#39' '#39') AS fio,'
      
        'p2.plastname || '#39' '#39' || SUBSTRING(p2.pname FROM 1 FOR 1) || '#39'. '#39' ' +
        '|| COALESCE(SUBSTRING(p2.ppatronymic FROM 1 FOR 1) || '#39'.'#39', '#39' '#39') ' +
        'AS fio_pedag,'
      
        '       CAST(0 AS D_FLOAT) AS itogo, rsp.RSPNOTE, rs1.RSTIMEBEGIN' +
        ', rs1.RSTIMEEND'
      'FROM rs_people rsp'
      'INNER JOIN rendering_services rs1 ON rs1.rsid = rsp.rsid'
      'INNER JOIN people p1 ON p1.pid = rsp.pid'
      'INNER JOIN people p2 ON p2.pid = rs1.PID_PEDAG'
      'INNER JOIN SYS_DIC sd ON sd.SDID = rs1.SDID'
      'WHERE rs1.rsisdelete IS NULL AND'
      '      rsp.rsoplatit IS NOT NULL AND'
      '      '
      '      rs1.pid_pedag = :pid'
      '      AND rs1.RSDATE BETWEEN :data1 AND :data2'
      'order by 7,4')
    GeneratorField.Field = 'TABID'
    Left = 296
    Top = 56
    ParamData = <
      item
        DataType = ftUnknown
        Name = 'pid'
        ParamType = ptUnknown
      end
      item
        DataType = ftUnknown
        Name = 'pid'
        ParamType = ptUnknown
      end
      item
        DataType = ftUnknown
        Name = 'data1'
        ParamType = ptUnknown
      end
      item
        DataType = ftUnknown
        Name = 'data2'
        ParamType = ptUnknown
      end>
    object DateField1: TDateField
      FieldName = 'RSDATE'
      Origin = '"RENDERING_SERVICES"."RSDATE"'
    end
    object IBStringField1: TIBStringField
      FieldName = 'SDNAME'
      Origin = '"SYS_DIC"."SDNAME"'
      Size = 255
    end
    object IBBCDField1: TIBBCDField
      FieldName = 'TARIF'
      ProviderFlags = []
      Precision = 18
      Size = 2
    end
    object IBBCDField2: TIBBCDField
      FieldName = 'RSPCORRECTION'
      Origin = '"RS_PEOPLE"."RSPCORRECTION"'
      Precision = 18
      Size = 2
    end
    object IBStringField2: TIBStringField
      FieldName = 'FIO'
      ProviderFlags = []
      Size = 769
    end
    object IBBCDField3: TIBBCDField
      FieldName = 'ITOGO'
      ProviderFlags = []
      Precision = 18
      Size = 2
    end
    object IBStringField3: TIBStringField
      FieldName = 'RSPNOTE'
      Origin = '"RS_PEOPLE"."RSPNOTE"'
      Size = 255
    end
    object intgrfld1: TIntegerField
      FieldName = 'PID'
      Origin = '"RS_PEOPLE"."PID"'
    end
    object intgrfld2: TIntegerField
      FieldName = 'RSID'
      Origin = '"RS_PEOPLE"."RSID"'
      Required = True
    end
    object IBStringField4: TIBStringField
      FieldName = 'FIO_PEDAG'
      ProviderFlags = []
      Size = 769
    end
    object TimeField1: TTimeField
      FieldName = 'RSTIMEBEGIN'
      Origin = '"RENDERING_SERVICES"."RSTIMEBEGIN"'
    end
    object TimeField2: TTimeField
      FieldName = 'RSTIMEEND'
      Origin = '"RENDERING_SERVICES"."RSTIMEEND"'
    end
  end
end
